{% extends "base.html" %}

{% block content %}
<div class="container-fluid">
    <div class="card">
        <div class="card-header">
            <h5 class="mb-0"><i class="fas fa-plus me-2"></i>记录水质数据</h5>
        </div>
        <div class="card-body">
            <form method="POST" action="{{ url_for('water.water_record', device_id=device.id) }}">
                <div class="mb-3">
                    <label for="device_id" class="form-label">设备ID</label>
                    <input type="text" class="form-control" id="device_id" value="{{ device.device_id }}" readonly>
                </div>
                <div class="mb-3">
                    <label for="name" class="form-label">设备名称</label>
                    <input type="text" class="form-control" id="name" value="{{ device.name }}" readonly>
                </div>
                <div class="mb-3">
                    <label for="ph" class="form-label">pH值</label>
                    <input type="number" step="0.01" class="form-control" id="ph" name="ph" required min="0" max="14">
                </div>
                <div class="mb-3">
                    <label for="turbidity" class="form-label">浊度 (NTU)</label>
                    <input type="number" step="0.01" class="form-control" id="turbidity" name="turbidity" required min="0">
                </div>
                <div class="mb-3">
                    <label for="dissolved_oxygen" class="form-label">溶解氧 (mg/L)</label>
                    <input type="number" step="0.01" class="form-control" id="dissolved_oxygen" name="dissolved_oxygen" required min="0">
                </div>
                <div class="mb-3">
                    <label for="conductivity" class="form-label">电导率 (μS/cm)</label>
                    <input type="number" step="0.01" class="form-control" id="conductivity" name="conductivity" required min="0">
                </div>
                <div class="mb-3">
                    <label for="temperature" class="form-label">温度 (℃)</label>
                    <input type="number" step="0.1" class="form-control" id="temperature" name="temperature" required>
                </div>
                <div class="d-flex justify-content-between">
                    <a href="{{ url_for('water.water_index') }}" class="btn btn-secondary">
                        <i class="fas fa-arrow-left me-1"></i>返回
                    </a>
                    <button type="submit" class="btn btn-primary">
                        <i class="fas fa-save me-1"></i>保存
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>
{% endblock %} 